<script type="text/javascript" src="portalBlog.js"></script>
<?php
$userlevel = $_SESSION['userlevel'];
?>
<div id="blogstatusbarGood">
	<?php echo "$nls_newblog_success_message"; ?>
</div>
<div id="blogstatusbarBad">
	<?php echo "$nls_newblog_error_message"; ?>
</div>
<?php
if ($userlevel > 0){
	echo "<p id=\"blogEdit\"><button id=\"blogEditButton\">$nls_blog_openeditor</button></p>";
	
	// store the user id (and level) in the dom to be used later on by a java script applet
	echo "<div id=\"userCredentials\" style=\"display:none\">";
	$domuserid = $_SESSION['userid'];
	echo $domuserid;
	echo "</div>";

}
?>

<div id="blogEditor">
	<form id="newBlogForm" method="POST">
		<p id="blogLeftChars" class="blogLeftChars"><?php echo "$nls_blog_left_chars"; ?><span id="blcNumber">140</span></p>
		<input type="hidden" name="userid" value="<?php echo $_SESSION['userid']; ?>" />
		<input type="hidden" name="username" value="<?php echo $_SESSION['username']; ?>" />
		<textarea id="blogText"></textarea>
		<input type="button" id="sendBlog" value="<?php echo "$nls_blog_submit";?>"/>
		<input type="button" id="cancelBlog" value="<?php echo "$nls_abort";?>"/>
	</form>
	
</div>
<div id="blogroll">
</div>
<?php 
echo "<div id=\"emptyBlogMessage\" class=\"divDialog\" title=\"$nls_message\">";
echo "<p>$nls_insert_text_to_publish</p>";
echo "</div>";
echo "<div id=\"blogErrorMessage\" class=\"divDialog\" title=\"$nls_error\">";
echo "<p>$nls_no_sufficient_priveleges</p>";
echo "</div>";
?>